<template>
  <div class="SearchFor">
    <el-form  :model="formInline" class="demo-form-inline" label-position="left" label-width="80px">
      <el-row :gutter="20">
        <el-col :span="5">
        <el-form-item label="用电企业">
          <!-- <el-select size="small" v-model="formInline.orgNo" placeholder="选择用电企业" clearable>
            <el-option v-for="(item, index) in qiyelist" :key="index" :label="item.bizOrgName" :value="item.bizOrgNo" ></el-option>
          </el-select> -->
          <FilterSelect2
                    v-model="formInline.orgNo"
                    :optionlist="qiyelist"
                    :valuekey="{ name: 'bizOrgName', value: 'bizOrgNo' }"
                  ></FilterSelect2>
        </el-form-item>
      </el-col>
      <el-col :span="5">
        <el-form-item label="缺陷编号">
          <el-input v-model="formInline.code" size="small" style="width: 100%;" placeholder=请输入缺陷编号></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="5">
        <el-form-item label="工单状态">
          <el-select size="small" v-model="formInline.state" placeholder="选择工单状态" style="width: 100%;" clearable>
            <el-option label="待提交" value="0" />
            <el-option label="待消缺" value="1" />
            <el-option label="待验收" value="2" />
            <el-option label="驳回" value="3" />
            <el-option label="完成" value="4" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="5">
        <el-form-item label="缺陷等级">
          <el-select size="small" v-model="formInline.level" placeholder="选择缺陷等级" style="width: 100%;" clearable>
            <el-option label="一般" value="0" />
            <el-option label="重要" value="1" />
            <el-option label="紧急" value="2" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="4" v-show="isshow">
        <el-form-item label="设备名称" >
          <el-input v-model="formInline.equipName" style="width: 100%;" size="small" placeholder=请输入设备名称进行模糊查询></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="5" v-show="isshow">
        <el-form-item label="消缺结果">
          <el-select size="small" v-model="formInline.solveType" style="width: 100%;" placeholder="选择消缺结果" clearable>
            <el-option label="已消缺" value="0" />
            <el-option label="未消缺" value="1" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8" v-show="isshow">
        <el-form-item label="发现时间">
          <el-date-picker
            v-model="value2"
            type="datetimerange"
            style="width: 100%;"
            size="small"
            range-separator="-"
            value-format="yyyy-MM-dd HH:mm:ss"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col :span="7" v-show="isshow">
        <el-form-item label=" "> </el-form-item>
      </el-col>
      <el-col :span="4" style="text-align: right;margin-top: 4px;">
        <!-- <el-form-item style="text-align: right;"> -->
          <div>
            <span><el-button size="small" style="margin-right: 10px;" @click="chongzhi">重 置</el-button></span>
            <span class="button"
              ><el-button size="small" type="primary" @click="chaxun">查 询</el-button></span
            >
            <span class="zhan" @click="zhankai">
              <span class="wen">{{ isshow ? '收起' : '展开' }}</span>
              <i v-if="isshow" class="el-icon-arrow-down"></i>
              <i v-else class="el-icon-arrow-up"></i>
            </span>
          </div>
        <!-- </el-form-item> -->
      </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>

export default {
  name: 'CallPoliceIndex',
  props: {
    qiyelist: {
      type: Array,
      default:()=>[]
    }
  },
  data() {
    return {
      isshow:false,
      formInline: {},
      value2:['','']
    };
  },

  mounted() {
    
  },

  methods: {
    chongzhi() {
      this.formInline={}
      this.value2 = ['', '']
      this.$emit('toshuaxin',this.formInline,this.value2)
     },
    chaxun() {
      this.$emit('toshuaxin',this.formInline,this.value2)
     },
    zhankai() {
      this.isshow = !this.isshow
      this.$emit('zhankai',this.isshow)
    }
  },
};
</script>
<style lang="scss" scoped>
.SearchFor{
  padding: 20px;
  .zhan{
    cursor: pointer;
    color:#1890ff;
    font-size: 14px;
  }
  .wen{
    margin:0 10px;
  }
}
</style>